package com.ck.master.service.impl;

import com.ck.master.dao.ResourceMapper;
import com.ck.master.model.Resource;
import com.ck.master.service.ResourceService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author yd
 * @Date 2018/12/21 17:09
 */
@Service
public class ResourceServiceImpl implements ResourceService {

    @Autowired
    private ResourceMapper resourceMapper;

    @Override
    public PageInfo<Resource> getResourceListWithPage(Integer page, Integer limit) {
        PageHelper.startPage(page,limit);
        List<Resource> resourceList = resourceMapper.selectByExample(null);
        return new PageInfo<>(resourceList);
    }
}
